<template>
  <van-cell :to="'/article/' + article.art_id">
    <!-- <van-cell :to="{name:'article',params:{articleId:article.art_id}}"></van-cell> -->
    <div slot="title" class="title van-multi-ellipsis--l2">
      {{ article.title }}
    </div>
    <div slot="label">
      <div v-if="article.cover.type === 3" class="cover-wrap">
        <van-image
          class="cover-item"
          v-for="(item, index) in article.cover.images"
          :key="index"
          :src="item"
        ></van-image>
      </div>
      <div class="label-info-wrap">
        <span>{{ article.aut_name }}</span>
        <span>{{ article.comm_count }}个p评论inlun</span>
        <span>{{ article.pubdate | relativeTime }}</span>
      </div>
    </div>
    <div slot="default" v-if="article.cover.type === 1">
      <van-image :src="article.cover.images[0]" class="right-cover"></van-image>
    </div>
  </van-cell>
</template>

<script>
export default {
  name: 'AricleItem',
  props: {
    article: {
      type: Object,
      require: true
    }
    // articleId: {
    //   type: [Number, String],
    //   require: true
    // }
  },
  components: {},
  data () {
    return {}
  },
  created () {},
  mounted () {},
  methods: {},
  watch: {},
  computed: {}
}
</script>

<style lang="less" scoped>
.title {
  font-size: 32px;
  color: #3a3a3a;
}
.van-cell__value {
  flex: unset;
  width: 232px;
  height: 146px;
  padding-left: 25px;
}
.right-cover {
  width: 232px;
  height: 146px;
}
.label-info-wrap span {
  font-size: 22px;
  color: #b4b4b4;
  margin-right: 25px;
}
.cover-wrap {
  display: flex;
  padding: 30px 0;
  .cover-item {
    flex: 1;
    &:not(:last-child) {
      padding-right: 4px;
    }
    width: 100%;
    height: 146px;
  }
}
</style>
